<?php defined('BASEPATH') or exit('No direct script access allowed');

class Module_News extends Module {

	public $version = 1.1;

	public function info()
	{
		return array(
			'name' => array(
				'es' => 'Escort news es',
				'en' => 'Escort news'
			),
			'description' => array(
				'es' => 'Escort news Management',
				'en' => 'Escort news Management'
				),
			'frontend' => TRUE,
			'backend' => TRUE,
			'skip_xss'	=> TRUE,
			'menu'		=> 'content',
			/*
		    'shortcuts' => array(
				array(
			 	   'name' => 'escort_news_create_title',
				    'uri' => 'admin/news/create',
				    'class' => 'add'
				),
			),
			*/
			'sections' => array(
			    'news' => array(
				    'name' => 'escort_news_title',
				    'uri' => 'admin/news',
				    'shortcuts' => array(
						array(
					 	   'name' => 'escort_news_create_title',
						    'uri' => 'admin/news/create',
						    'class' => 'add'
						),
					),
				),
				'categories' => array(
				    'name' => 'escort_news_cat_list_title',
				    'uri' => 'admin/news/categories',
				    'shortcuts' => array(
						array(
						    'name' => 'escort_news_cat_create_title',
						    'uri' => 'admin/news/categories/create',
						    'class' => 'add'
						),
					),
				),
			),
		);
	}

	public function install()
	{
		$this->dbforge->drop_table('escort_news');
		$this->dbforge->drop_table('escort_news_categories');
		$this->db->query("
					CREATE  TABLE IF NOT EXISTS ".$this->db->dbprefix('escort_news_categories')." (
		  				 `id` INT NOT NULL AUTO_INCREMENT ,

  						`category` VARCHAR(45) NULL ,
					  PRIMARY KEY (`id`)
					) ENGINE=InnoDB DEFAULT CHARSET=utf8
				");
		return $this->db->query("
			CREATE  TABLE IF NOT EXISTS ".$this->db->dbprefix('escort_news')." (
  				 `id` INT NOT NULL AUTO_INCREMENT ,

				  `title` VARCHAR(255) NULL ,
				
				  `news` TINYTEXT NULL ,
				
				  `category_id` INT NULL ,
				
				  `language_id` INT NULL ,
				
				  `site_ref` VARCHAR(45) NULL ,
				
				  `created_time` VARCHAR(45) NULL ,
				
				  `status` VARCHAR(45) NULL ,
			  PRIMARY KEY (`id`)
			) ENGINE=InnoDB DEFAULT CHARSET=utf8
		");
	}

	public function uninstall()
	{
		return TRUE;
	}

	public function upgrade($old_version)
	{
		// Your Upgrade Logic
		return TRUE;
	}

	public function help()
	{
		// Return a string containing help info
		// You could include a file and return it here.
		return "This module has no inline docs as it does not have a back-end.";
	}
}
/* End of file details.php */